package wahadlo.nowe.math;

public class Location implements Function {

	private Double a0;
	private Double beta;
	private Double length;
	private Double inclination;

	public Location(Double a0, Double beta, Double length, Double inclination) {
		this.a0 = a0;
		this.beta = beta;
		this.length = length;
		this.inclination = inclination;
	}

	public Double getValue(Double... points) {
		Double t;
		if (points != null && points.length > 0) {
			t = points[0];
		} else {
			throw new NullPointerException();
		}
		Double a0Value = a0 * Math.pow(Math.E, (-beta * t));
		Double cosValue = Math.cos(Math.sqrt(length / Function.G) * t + inclination);
		return cosValue * a0Value;
	}
}
